<?php

/**
 * @file
 * Theme settings .
 */

function md_bonv_theme_settings_design(&$form, &$form_state) {
	$form['md_bonv_settings']['design'] = array(
		'#type' 					=> 'fieldset',
		'#weight' 				=> -4,
		'#prefix'  				=> '<div id="md-design" class="md-tabcontent clearfix">',
		'#suffix'        => '</div><!-- / #md-design -->',
	);
	
	$form['md_bonv_settings']['design']['design_htmllist'] = array(
		'#markup' 				=> '<div class="md-listleft">
				<ul>
					<li><a href="#ds-background">Background</a></li>
					<li><a href="#ds-header">Header</a></li>
					<li><a href="#ds-footer">Footer</a></li>
				</ul>
			</div><div class="md-listcontent">',
		'#weight' 				=> -15,
	);
	$form['md_bonv_settings']['design']['design_htmllistclose'] = array(
		'#markup' 				=> '</div><!-- /.md-listleft -->',
		'#weight' 				=> 15,
	);
	
	/* 1.	Background
	--------------------------------------------------------------------------*/
	$form['md_bonv_settings']['design']['design_background'] = array(
		'#type' 					=> 'fieldset',
		'#weight' 				=> -5,
		'#prefix'  				=> '<div id="ds-background" class="md-tabcontent clearfix">',
		'#suffix'        => '</div><!-- / #ds-background -->',
	);
	
		// Background settings
		$form['md_bonv_settings']['design']['design_background']['bg_color'] = array(
	    '#type'          => 'textfield',
	    '#title'         => t('Background-color'),
	    '#default_value' => theme_get_setting('bg_color'),
			'#prefix' => '<div class="form-font-color">',
			'#suffix' => '</div>',
	  );
		
		$form['md_bonv_settings']['design']['design_background']['choose_bg'] = array(
	    '#type'          => 'select',
	    '#title'         => t('Choose background'),
			'#description'   => t('Choose background or choose "Custom" to upload your custom background'),
	    '#default_value' => theme_get_setting('choose_bg'),
	    '#options'       => array(
														'0'   => t('Default'),
														'1'		=> t('Pattern'),
														'2'   => t('Custom Image'),
	                        ),
	  );
		
		$form['md_bonv_settings']['design']['design_background']['choose_pattern'] = array(
	    '#type'          => 'select',
	    '#title'         => t('Choose Pattern'),
	    '#default_value' => theme_get_setting('choose_pattern'),
	    '#options'       => array(
	                          '01'  => t('Pattern 1'),
	                          '02' 	=> t('Pattern 2'),
														'03' 	=> t('Pattern 3'),
														'04' 	=> t('Pattern 4'),
														'05' 	=> t('Pattern 5'),
														'06' 	=> t('Pattern 6'),
														'07' 	=> t('Pattern 7'),
														'08' 	=> t('Pattern 8'),
														'09' 	=> t('Pattern 9'),
														'10' 	=> t('Pattern 10'),
														'11'  => t('Pattern 11'),
														'12'  => t('Pattern 12'),
														'13'  => t('Pattern 13'),
														'14'  => t('Pattern 14'),
														'15'  => t('Pattern 15'),
														'16'  => t('Pattern 16'),
														'17'  => t('Pattern 17'),
														'18'  => t('Pattern 18'),
														'19'  => t('Pattern 19'),
														'20' 	=> t('Pattern 20'),
														'21' 	=> t('Pattern 21'),
														'22' 	=> t('Pattern 22'),
														'23' 	=> t('Pattern 23'),
														'24' 	=> t('Pattern 24'),
														'25' 	=> t('Pattern 25'),
														'26' 	=> t('Pattern 26'),
														'27' 	=> t('Pattern 27'),
														'28' 	=> t('Pattern 28'),
														'29' 	=> t('Pattern 29'),
														'30' 	=> t('Pattern 30'),
														'31' 	=> t('Pattern 31'),
														'32' 	=> t('Pattern 32'),
														'33' 	=> t('Pattern 33'),
														'34' 	=> t('Pattern 34'),
														'35' 	=> t('Pattern 35'),
														'36' 	=> t('Pattern 36'),
														'37' 	=> t('Pattern 37'),
														'38' 	=> t('Pattern 38'),
														'39' 	=> t('Pattern 39'),
														'40' 	=> t('Pattern 40'),
														'41' 	=> t('Pattern 41'),
														'42' 	=> t('Pattern 42'),
														'43' 	=> t('Pattern 43'),
														'44' 	=> t('Pattern 44'),
	                        ),
			'#prefix' => '<div id="design-bg-pattern" class="clearfix">',
			'#suffix' => '</div>',
	  );
		
		$bg_path = theme_get_setting('bg_path');
		// If $bg_path is a public:// URI, display the path relative to the files directory
		if (file_uri_scheme($bg_path) == 'public') {
			$bg_path = file_uri_target($bg_path);
		}
	   
	  $form['md_bonv_settings']['design']['design_background']['bg_path'] = array(
	    '#type' => 'textfield',
	    '#title' => t('Path to custom background'),
	    '#default_value' =>  $bg_path,
			'#description'	=> t('The path to the image file you would like to use as your website background.'),
			'#prefix' => '<div id="design-bg-custom" class="clearfix">',
	  );
	
	  $form['md_bonv_settings']['design']['design_background']['bg_upload'] = array(
	    '#type' => 'file',
	  );
		
		$form['md_bonv_settings']['design']['design_background']['bg_repeat'] = array(
	    '#type'          => 'select',
	    '#title'         => t('Background repeat'),
	    '#default_value' => theme_get_setting('bg_repeat'),
	    '#options'       => array(
	                          'inherit'   => t('Inherit'),
	                          'repeat'    => t('Repeat'),
														'repeat-x'  => t('Repeat X'),
														'repeat-y'  => t('Repeat Y'),
														'no-repeat' => t('No repeat'),
	                        ),
	  );
		
		$form['md_bonv_settings']['design']['design_background']['bg_position'] = array(
	    '#type'          => 'select',
	    '#title'         => t('Background position'),
	    '#default_value' => theme_get_setting('bg_position'),
	    '#options'       => array(
	                          'left top'   => t('Left Top'),
														'left center'   => t('Left Center'),
	                          'left bottom'    => t('Left Bottom'),
														'center center'  => t('Center Center'),
														'center top'  => t('Center Top'),
														'center bottom'  => t('Center Bottom'),
														'right top'  => t('Right Top'),
														'right center'  => t('Right Center'),
														'right bottom'  => t('Right Bottom'),
	                        ),
	  );
		
		$form['md_bonv_settings']['design']['design_background']['bg_attachment'] = array(
	    '#type'          => 'select',
	    '#title'         => t('Background Attachment'),
	    '#default_value' => theme_get_setting('bg_attachment'),
	    '#options'       => array(
	                          'scroll'   => t('Scroll'),
														'fixed'   => t('Fixed'),
	                        ),
			'#suffix' => '</div>',
	  );
	
	/* 2.	Header
	--------------------------------------------------------------------------*/
	$form['md_bonv_settings']['design']['design_header'] = array(
		'#type' 					=> 'fieldset',
		'#weight' 				=> -5,
		'#prefix'  				=> '<div id="ds-header" class="md-tabcontent clearfix">',
		'#suffix'        => '</div><!-- / #ds-header -->',
	);
		$form['md_bonv_settings']['design']['design_header']['header_top_settings'] = array(
			'#type'          => 'fieldset',
			'#title'         => t('Header top settings'),
		);
		  
			$form['md_bonv_settings']['design']['design_header']['header_top_settings']['ht_type'] = array(
		    '#type'          => 'select',
		    '#title'         => t('Type block on top'),
		    '#default_value' => theme_get_setting('ht_type'),
		    '#options'       => array(
															'0'   => t('None'),
															'1'		=> t('Custom text'),
															'2'   => t('Block region')
		                        ),
		  );
			$form['md_bonv_settings']['design']['design_header']['header_top_settings']['ht_text'] = array(
				'#type'          	=> 'textfield',
				'#title'         => t('Use text'),
				'#default_value' 	=> theme_get_setting('ht_text'),
			);
			
			$form['md_bonv_settings']['design']['design_header']['header_top_settings']['ht_bg_color'] = array(
					'#type'          	=> 'textfield',
					'#title'         	=> t('Background color'),
					'#default_value' 	=> theme_get_setting('ht_bg_color'),
					'#prefix' => '<div class="form-font-color width155">',
					'#suffix' => '</div>',
					'#attributes' 		=> array(
															'class' => array(
																'form-colorpicker',
															),
		      ),
				);
				
		$form['md_bonv_settings']['design']['design_header']['header_bg'] = array(
			'#type'          => 'fieldset',
			'#title'         => t('Header background'),
		);
		
			$form['md_bonv_settings']['design']['design_header']['header_bg']['header_bg_color'] = array(
					'#type'          	=> 'textfield',
					'#title'         	=> t('Background color'),
					'#default_value' 	=> theme_get_setting('header_bg_color'),
					'#prefix' => '<div class="form-font-color width155">',
					'#suffix' => '</div>',
					'#attributes' 		=> array(
															'class' => array(
																'form-colorpicker',
															),
		      ),
				);
				
		$form['md_bonv_settings']['design']['design_header']['header_bb'] = array(
			'#type'          => 'fieldset',
			'#title'         => t('Header bottom border'),
		);
			
			$form['md_bonv_settings']['design']['design_header']['header_bb']['header_bb_size'] = array(
				'#type'          	=> 'textfield',
				'#title'         => t('Border size (pixel)'),
				'#default_value' 	=> theme_get_setting('header_bb_size'),
			);
		
			$form['md_bonv_settings']['design']['design_header']['header_bb']['header_bb_color'] = array(
					'#type'          	=> 'textfield',
					'#title'         	=> t('Border color'),
					'#default_value' 	=> theme_get_setting('header_bb_color'),
					'#prefix' => '<div class="form-font-color width155">',
					'#suffix' => '</div>',
					'#attributes' 		=> array(
															'class' => array(
																'form-colorpicker',
															),
		      ),
				);
	
	/* 3.	Footer
	--------------------------------------------------------------------------*/
	$form['md_bonv_settings']['design']['design_footer'] = array(
		'#type' 					=> 'fieldset',
		'#weight' 				=> -5,
		'#prefix'  				=> '<div id="ds-footer" class="md-tabcontent clearfix">',
		'#suffix'        => '</div><!-- / #ds-footer -->',
	);
	
		$form['md_bonv_settings']['design']['design_footer']['footer_bg'] = array(
			'#type'          => 'fieldset',
			'#title'         => t('Footer background'),
		);
		
			$form['md_bonv_settings']['design']['design_footer']['footer_bg']['footer_bg_color'] = array(
					'#type'          	=> 'textfield',
					'#title'         	=> t('Background color'),
					'#default_value' 	=> theme_get_setting('footer_bg_color'),
					'#prefix' => '<div class="form-font-color width155">',
					'#suffix' => '</div>',
					'#attributes' 		=> array(
															'class' => array(
																'form-colorpicker',
															),
		      ),
				);
			
			$form['md_bonv_settings']['design']['design_footer']['footer_bg']['footer_bo_size'] = array(
					'#type'          	=> 'textfield',
					'#title'         	=> t('Border size'),
					'#default_value' 	=> theme_get_setting('footer_bo_size'),
					'#description'		=> t('type your border size, in pixel (px)'),
				);
				
			$form['md_bonv_settings']['design']['design_footer']['footer_bg']['footer_bo_color'] = array(
					'#type'          	=> 'textfield',
					'#title'         	=> t('Border color'),
					'#default_value' 	=> theme_get_setting('footer_bo_color'),
					'#prefix' => '<div class="form-font-color width155">',
					'#suffix' => '</div>',
					'#attributes' 		=> array(
															'class' => array(
																'form-colorpicker',
															),
		      ),
				);
}